using System;

namespace ZFramework
{
    public struct Ray
    {
        public Vec3 Origin { get; set; }
        private Vec3 _direction;
        public Vec3 Direction
        {
            readonly get => _direction;
            set => _direction = value.Normalized();
        }
        public Ray(Vec3 origin, Vec3 direction)
        {
            Origin = origin;
            Direction = direction;
        }

        public Ray(Vec3 direction) : this(Vec3.Zero, direction) { }

    }
}